﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Manager.Master" AutoEventWireup="true" CodeBehind="MenuItemsManager.aspx.cs" Inherits="Bilyteam_Website.Admin.MenuItemsManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <asp:ScriptManager ID="ScriptManager1" runat="server">
   </asp:ScriptManager>
   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
       <ContentTemplate>
    <center>
     <div style="margin-top:50px">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1" EnableModelValidation="True"  DataKeyNames="MenuItemID"
            BackColor="#CCFF99" BorderColor="White" Width="874px">
            <Columns>
                <asp:BoundField DataField="MenuItemID" HeaderText="MenuItemID" />
                <asp:BoundField DataField="MenuItemName" HeaderText="MenuItemName" />
                <asp:BoundField DataField="Link" HeaderText="Link" />
                <asp:BoundField DataField="Parrent" HeaderText="Parrent" />
                <asp:BoundField DataField="IDMenu" HeaderText="IDMenu" />
                <asp:CommandField ShowEditButton="True" />
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PROJECT %>" 
            SelectCommand="SELECT * FROM [MenuItems] WHERE ([Status] = @Status)"
            DeleteCommand="DELETE FROM [MenuItems] WHERE [MenuItemID] = @MenuItemID"
            UpdateCommand="UPDATE [MenuItems] SET [MenuItemName] = @MenuItemName, [Link] = @Link, [Parrent] = @Parrent, [IDMenu] = @IDMenu WHERE [MenuItemID] = @MenuItemID">
        <DeleteParameters>
            <asp:Parameter Name="MenuItemID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="MenuItemName" Type="String" />
            <asp:Parameter Name="Link" Type="String" />
            <asp:Parameter Name="Parrent" Type="Int32" />
            <asp:Parameter Name="IDMenu" Type="Int32" />
            <asp:Parameter Name="MenuItemID" Type="Int32" />
        </UpdateParameters>
            <SelectParameters>
                <asp:Parameter DefaultValue="True" Name="Status" Type="Boolean" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
       <div style="width:500px">
        <table id="Table" style="width: 55%; height: 94px;">
            <tr>
                <td class="style2">
                    <asp:Label ID="lbCategoryName" runat="server" Text="CategoryName"></asp:Label>
                &nbsp;:</td>
                <td>
                    <asp:TextBox ID="txtCategoryName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="lbLink" runat="server" Text="Link"></asp:Label>
                &nbsp;:</td>
                <td>
                    <asp:TextBox ID="txtLink" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style3">
                    <asp:Label ID="Parrent" runat="server" Text="Parrent"></asp:Label>
                &nbsp;:</td>
                <td class="style1">
                    <asp:TextBox ID="txtParrent" runat="server" ReadOnly="True">0</asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style3">
                    <asp:Label ID="lbType" runat="server" Text="Type"></asp:Label>
                &nbsp;:</td>
                <td class="style1">
                    <asp:TextBox ID="txtIDMenu" runat="server" ReadOnly="True">1</asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style3">
                    <asp:Button ID="btInsert" runat="server" onclick="btInsert_Click" 
                        Text="Insert" />
                </td>
                <td class="style1">
                    <asp:Button ID="btCancel" runat="server" Text="Cancel" 
                        onclick="btCancel_Click" />
                </td>
            </tr>
            <tr>
               <td>
                   <asp:Label ID="lbTest" runat="server" ForeColor="Red"></asp:Label>
               </td>
            </tr>
        </table>
      </div>
    </div>
  </center>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
